package com.lixw.langchain.controller;

import dev.langchain4j.model.chat.ChatModel;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: PopularIntegrationController
 * @Description: SpringBoot整合使用底层API
 * @Author: xuweiLi
 * @Create: 2025/8/22 19:06
 **/
@RestController
public class PopularIntegrationController {
    @Resource
    private ChatModel qwenChatModel;

    @GetMapping("/low/chat")
    public String lowChat(@RequestParam(value = "prompt",defaultValue = "你是谁") String prompt) {
        return qwenChatModel.chat(prompt);
    }
}